import 'package:xin_he/generated/json/base/json_convert_content.dart';
import 'package:xin_he/page/shopping_car/xin_he_shopping_car/xin_he_shop_cart_goods_entity.dart';

XinHeShopCartGoodsEntity $XinHeShopCartGoodsEntityFromJson(Map<String, dynamic> json) {
	final XinHeShopCartGoodsEntity xinHeShopCartGoodsEntity = XinHeShopCartGoodsEntity();
	final String? sellerUserId = jsonConvert.convert<String>(json['sellerUserId']);
	if (sellerUserId != null) {
		xinHeShopCartGoodsEntity.sellerUserId = sellerUserId;
	}
	final String? sellerName = jsonConvert.convert<String>(json['sellerName']);
	if (sellerName != null) {
		xinHeShopCartGoodsEntity.sellerName = sellerName;
	}
	final int? amount = jsonConvert.convert<int>(json['amount']);
	if (amount != null) {
		xinHeShopCartGoodsEntity.amount = amount;
	}
	final double? sumFee = jsonConvert.convert<double>(json['sumFee']);
	if (sumFee != null) {
		xinHeShopCartGoodsEntity.sumFee = sumFee;
	}
	final int? freightFee = jsonConvert.convert<int>(json['freightFee']);
	if (freightFee != null) {
		xinHeShopCartGoodsEntity.freightFee = freightFee;
	}
	final int? goodsSumFee = jsonConvert.convert<int>(json['goodsSumFee']);
	if (goodsSumFee != null) {
		xinHeShopCartGoodsEntity.goodsSumFee = goodsSumFee;
	}
	final bool? isSelected = jsonConvert.convert<bool>(json['isSelected']);
	if (isSelected != null) {
		xinHeShopCartGoodsEntity.isSelected = isSelected;
	}
	final int? zoneType = jsonConvert.convert<int>(json['zoneType']);
	if (zoneType != null) {
		xinHeShopCartGoodsEntity.zoneType = zoneType;
	}
	final List<XinHeShopCartGoodsOrderItems>? orderItems = jsonConvert.convertListNotNull<XinHeShopCartGoodsOrderItems>(json['orderItems']);
	if (orderItems != null) {
		xinHeShopCartGoodsEntity.orderItems = orderItems;
	}
	return xinHeShopCartGoodsEntity;
}

Map<String, dynamic> $XinHeShopCartGoodsEntityToJson(XinHeShopCartGoodsEntity entity) {
	final Map<String, dynamic> data = <String, dynamic>{};
	data['sellerUserId'] = entity.sellerUserId;
	data['sellerName'] = entity.sellerName;
	data['amount'] = entity.amount;
	data['sumFee'] = entity.sumFee;
	data['freightFee'] = entity.freightFee;
	data['goodsSumFee'] = entity.goodsSumFee;
	data['isSelected'] = entity.isSelected;
	data['zoneType'] = entity.zoneType;
	data['orderItems'] =  entity.orderItems?.map((v) => v.toJson()).toList();
	return data;
}

XinHeShopCartGoodsOrderItems $XinHeShopCartGoodsOrderItemsFromJson(Map<String, dynamic> json) {
	final XinHeShopCartGoodsOrderItems xinHeShopCartGoodsOrderItems = XinHeShopCartGoodsOrderItems();
	final String? orderItemId = jsonConvert.convert<String>(json['orderItemId']);
	if (orderItemId != null) {
		xinHeShopCartGoodsOrderItems.orderItemId = orderItemId;
	}
	final String? fUserId = jsonConvert.convert<String>(json['fUserId']);
	if (fUserId != null) {
		xinHeShopCartGoodsOrderItems.fUserId = fUserId;
	}
	final String? fGoodsId = jsonConvert.convert<String>(json['fGoodsId']);
	if (fGoodsId != null) {
		xinHeShopCartGoodsOrderItems.fGoodsId = fGoodsId;
	}
	final String? goodsName = jsonConvert.convert<String>(json['goodsName']);
	if (goodsName != null) {
		xinHeShopCartGoodsOrderItems.goodsName = goodsName;
	}
	final String? goodsIconPath = jsonConvert.convert<String>(json['goodsIconPath']);
	if (goodsIconPath != null) {
		xinHeShopCartGoodsOrderItems.goodsIconPath = goodsIconPath;
	}
	final double? goodsPrice = jsonConvert.convert<double>(json['goodsPrice']);
	if (goodsPrice != null) {
		xinHeShopCartGoodsOrderItems.goodsPrice = goodsPrice;
	}
	final int? goodsAmount = jsonConvert.convert<int>(json['goodsAmount']);
	if (goodsAmount != null) {
		xinHeShopCartGoodsOrderItems.goodsAmount = goodsAmount;
	}
	final String? goodsSellerUserId = jsonConvert.convert<String>(json['goodsSellerUserId']);
	if (goodsSellerUserId != null) {
		xinHeShopCartGoodsOrderItems.goodsSellerUserId = goodsSellerUserId;
	}
	final String? goodsSellerName = jsonConvert.convert<String>(json['goodsSellerName']);
	if (goodsSellerName != null) {
		xinHeShopCartGoodsOrderItems.goodsSellerName = goodsSellerName;
	}
	final int? zoneType = jsonConvert.convert<int>(json['zoneType']);
	if (zoneType != null) {
		xinHeShopCartGoodsOrderItems.zoneType = zoneType;
	}
	final bool? isSelected = jsonConvert.convert<bool>(json['isSelected']);
	if (isSelected != null) {
		xinHeShopCartGoodsOrderItems.isSelected = isSelected;
	}
	return xinHeShopCartGoodsOrderItems;
}

Map<String, dynamic> $XinHeShopCartGoodsOrderItemsToJson(XinHeShopCartGoodsOrderItems entity) {
	final Map<String, dynamic> data = <String, dynamic>{};
	data['orderItemId'] = entity.orderItemId;
	data['fUserId'] = entity.fUserId;
	data['fGoodsId'] = entity.fGoodsId;
	data['goodsName'] = entity.goodsName;
	data['goodsIconPath'] = entity.goodsIconPath;
	data['goodsPrice'] = entity.goodsPrice;
	data['goodsAmount'] = entity.goodsAmount;
	data['goodsSellerUserId'] = entity.goodsSellerUserId;
	data['goodsSellerName'] = entity.goodsSellerName;
	data['zoneType'] = entity.zoneType;
	data['isSelected'] = entity.isSelected;
	return data;
}